home *** CD-ROM | disk | FTP | other *** search
Wrap
global gCast, gSize, gVariable, gSecondColor, myCurrentImage, myCurrentSelection, myCurrentPreview, myTimerStart, gSelectRect, gMarqueeRect, gSelectionEdited, myStartImage on toolSelect startX = ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left startY = ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top repeat while the mouseDown if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) = startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) = startY) then sprite(4).rect = rect(startX, startY, startX, startY) sprite(5).rect = rect(startX, startY, startX, startY) sprite(6).rect = rect(startX, startY, startX, startY) sprite(7).rect = rect(startX, startY, startX, startY) else if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) < startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) < startY) then sprite(4).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, startX + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + 1) sprite(5).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + 1, startY + gVariable) sprite(6).rect = rect(startX + gVariable - 1, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, startX + gVariable, startY + gVariable) sprite(7).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, startY + gVariable - 1, startX + gVariable, startY + gVariable) else if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) > startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) > startY) then sprite(4).rect = rect(startX, startY, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, startY + 1) sprite(5).rect = rect(startX, startY, startX + 1, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) sprite(6).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable - 1, startY, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) sprite(7).rect = rect(startX, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable - 1, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) else if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) >= startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) <= startY) then sprite(4).rect = rect(startX, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + 1) sprite(5).rect = rect(startX, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, startX + 1, startY + gVariable) sprite(6).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable - 1, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, startY + gVariable) sprite(7).rect = rect(startX, startY + gVariable - 1, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + gVariable, startY + gVariable) else if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) <= startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) >= startY) then sprite(4).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, startY, startX + gVariable, startY + 1) sprite(5).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, startY, ((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left + 1, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) sprite(6).rect = rect(startX + gVariable - 1, startY, startX + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) sprite(7).rect = rect(((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable - 1, startX + gVariable, ((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top + gVariable) end if end if end if end if put sprite(4).width / gVariable into field "dimension status W" put sprite(5).height / gVariable into field "dimension status H" end if updateStage() end repeat if ((((the mouseH - sprite(1).left) / gVariable * gVariable) + sprite(1).left) = startX) and ((((the mouseV - sprite(1).top) / gVariable * gVariable) + sprite(1).top) = startY) then if gSelectionEdited = 1 then sprite(35).pState = 0 sendSprite(35, #setMember) member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image end if myStartImage = VOID myCurrentImage = VOID myCurrentPreview = VOID myCurrentSelection = VOID myTimerStart = 0 gSelectionEdited = VOID gMarqueeRect = rect(0, 0, 0, 0) gSelectRect = rect(0, 0, 0, 0) sprite(4).rect = rect(800, 600, 810, 610) sprite(5).rect = rect(800, 600, 810, 610) sprite(6).rect = rect(800, 600, 810, 610) sprite(7).rect = rect(800, 600, 810, 610) put EMPTY into field "dimension status W" put EMPTY into field "dimension status H" updateStage() pass() else if (sprite(4).top < sprite(1).top) and (sprite(6).right > sprite(1).right) then sprite(4).rect = rect(sprite(4).left, sprite(1).top, sprite(1).right, sprite(1).top + 1) sprite(5).rect = rect(sprite(5).left, sprite(1).top, sprite(5).right, sprite(5).bottom) sprite(6).rect = rect(sprite(1).right - 1, sprite(1).top, sprite(1).right, sprite(6).bottom) sprite(7).rect = rect(sprite(7).left, sprite(7).top, sprite(1).right, sprite(7).bottom) else if (sprite(7).bottom > sprite(1).bottom) and (sprite(6).right > sprite(1).right) then sprite(4).rect = rect(sprite(4).left, sprite(4).top, sprite(1).right, sprite(4).bottom) sprite(5).rect = rect(sprite(5).left, sprite(5).top, sprite(5).right, sprite(1).bottom) sprite(6).rect = rect(sprite(1).right - 1, sprite(6).top, sprite(1).right, sprite(1).bottom) sprite(7).rect = rect(sprite(7).left, sprite(1).bottom - 1, sprite(1).right, sprite(1).bottom) else if (sprite(4).top < sprite(1).top) and (sprite(5).left < sprite(1).left) then sprite(4).rect = rect(sprite(1).left, sprite(1).top, sprite(4).right, sprite(1).top + 1) sprite(5).rect = rect(sprite(1).left, sprite(1).top, sprite(1).left + 1, sprite(5).bottom) sprite(6).rect = rect(sprite(6).left, sprite(1).top, sprite(6).right, sprite(6).bottom) sprite(7).rect = rect(sprite(1).left, sprite(7).top, sprite(7).right, sprite(7).bottom) else if (sprite(7).bottom > sprite(1).bottom) and (sprite(5).left < sprite(1).left) then sprite(4).rect = rect(sprite(1).left, sprite(4).top, sprite(4).right, sprite(4).bottom) sprite(5).rect = rect(sprite(1).left, sprite(5).top, sprite(1).left + 1, sprite(1).bottom) sprite(6).rect = rect(sprite(6).left, sprite(6).top, sprite(6).right, sprite(1).bottom) sprite(7).rect = rect(sprite(1).left, sprite(1).bottom - 1, sprite(7).right, sprite(1).bottom) else if sprite(4).top < sprite(1).top then sprite(4).rect = rect(sprite(4).left, sprite(1).top, sprite(4).right, sprite(1).top + 1) sprite(5).rect = rect(sprite(5).left, sprite(1).top, sprite(5).right, sprite(5).bottom) sprite(6).rect = rect(sprite(6).left, sprite(1).top, sprite(6).right, sprite(6).bottom) else if sprite(6).right > sprite(1).right then sprite(4).rect = rect(sprite(4).left, sprite(4).top, sprite(1).right, sprite(4).bottom) sprite(6).rect = rect(sprite(1).right - 1, sprite(6).top, sprite(1).right, sprite(6).bottom) sprite(7).rect = rect(sprite(7).left, sprite(7).top, sprite(1).right, sprite(7).bottom) else if sprite(7).bottom > sprite(1).bottom then sprite(5).rect = rect(sprite(5).left, sprite(5).top, sprite(5).right, sprite(1).bottom) sprite(6).rect = rect(sprite(6).left, sprite(6).top, sprite(6).right, sprite(1).bottom) sprite(7).rect = rect(sprite(7).left, sprite(1).bottom - 1, sprite(7).right, sprite(1).bottom) else if sprite(5).left < sprite(1).left then sprite(4).rect = rect(sprite(1).left, sprite(4).top, sprite(4).right, sprite(4).bottom) sprite(5).rect = rect(sprite(1).left, sprite(5).top, sprite(1).left + 1, sprite(5).bottom) sprite(7).rect = rect(sprite(1).left, sprite(7).top, sprite(7).right, sprite(7).bottom) end if end if end if end if end if end if end if end if put sprite(4).width / gVariable into field "dimension status W" put sprite(5).height / gVariable into field "dimension status H" updateStage() if gSelectionEdited = 1 then sprite(35).pState = 0 sendSprite(35, #setMember) member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image end if gMarqueeRect = rect(sprite(5).left, sprite(4).top, sprite(6).right, sprite(7).bottom) gSelectRect = rect((sprite(5).left - sprite(1).left) / gVariable, (sprite(4).top - sprite(1).top) / gVariable, (sprite(6).right - sprite(1).left) / gVariable, (sprite(7).bottom - sprite(1).top) / gVariable) myTimerStart = the milliSeconds gSelectionEdited = 0 myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image) myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image) myCurrentPreview = duplicate(member("preview", gCast).image) myCurrentSelection = image(gSelectRect.width, gSelectRect.height, member(gSize & "x" & gSize, gCast).depth, member(gSize & "x" & gSize, gCast).paletteRef) if (myCurrentSelection = VOID) or (gSelectRect.width <= 0) or (gSelectRect.height <= 0) or (sprite(4).top <> sprite(5).top) or (sprite(7).bottom <> sprite(6).bottom) or (sprite(4).width <> sprite(7).width) or (sprite(5).height <> sprite(6).height) then myStartImage = VOID myCurrentImage = VOID myCurrentPreview = VOID myCurrentSelection = VOID myTimerStart = 0 gSelectionEdited = VOID gMarqueeRect = rect(0, 0, 0, 0) gSelectRect = rect(0, 0, 0, 0) sprite(4).rect = rect(800, 600, 810, 610) sprite(5).rect = rect(800, 600, 810, 610) sprite(6).rect = rect(800, 600, 810, 610) sprite(7).rect = rect(800, 600, 810, 610) put EMPTY into field "dimension status W" put EMPTY into field "dimension status H" updateStage() else myCurrentSelection.copyPixels(member(gSize & "x" & gSize, gCast).image, myCurrentSelection.rect, gSelectRect) end if end if end on moveSelect moverX = (the mouseH - sprite(1).left) / gVariable moverY = (the mouseV - sprite(1).top) / gVariable if gSelectionEdited = 0 then if the shiftDown <> 1 then myStartImage.fill(gSelectRect, gSecondColor) end if member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image end if repeat while the mouseDown selectXDistance = ((the mouseH - sprite(1).left) / gVariable) - moverX selectYDistance = ((the mouseV - sprite(1).top) / gVariable) - moverY myCurrentImage.copyPixels(myStartImage, myCurrentImage.rect, myStartImage.rect) gSelDestRect = rect(gSelectRect[1] + selectXDistance, gSelectRect[2] + selectYDistance, gSelectRect[3] + selectXDistance, gSelectRect[4] + selectYDistance) sprite(4).rect = rect((gSelDestRect.left * gVariable) + sprite(1).left, (gSelDestRect.top * gVariable) + sprite(1).top, (gSelDestRect.right * gVariable) + sprite(1).left, (gSelDestRect.top * gVariable) + sprite(1).top + 1) sprite(5).rect = rect((gSelDestRect.left * gVariable) + sprite(1).left, (gSelDestRect.top * gVariable) + sprite(1).top, (gSelDestRect.left * gVariable) + sprite(1).left + 1, (gSelDestRect.bottom * gVariable) + sprite(1).top) sprite(6).rect = rect((gSelDestRect.right * gVariable) + sprite(1).left - 1, (gSelDestRect.top * gVariable) + sprite(1).top, (gSelDestRect.right * gVariable) + sprite(1).left, (gSelDestRect.bottom * gVariable) + sprite(1).top) sprite(7).rect = rect((gSelDestRect.left * gVariable) + sprite(1).left, (gSelDestRect.bottom * gVariable) + sprite(1).top - 1, (gSelDestRect.right * gVariable) + sprite(1).left, (gSelDestRect.bottom * gVariable) + sprite(1).top) myCurrentImage.copyPixels(myCurrentSelection, gSelDestRect, myCurrentSelection.rect) member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect) updateStage() fnUpdatePreview() end repeat tL = point(sprite(4).left + 1, sprite(4).top + 1) tR = point(sprite(4).right - 1, sprite(4).top + 1) bL = point(sprite(7).left + 1, sprite(7).bottom - 1) bR = point(sprite(7).right - 1, sprite(7).bottom - 1) if not inside(tL, sprite(1).rect) and not inside(tR, sprite(1).rect) and not inside(bL, sprite(1).rect) and not inside(bR, sprite(1).rect) and (sprite(1).rect.intersect(rect(tL[1], tL[2], bR[1], bR[2])) = rect(0, 0, 0, 0)) then myCurrentImage.copyPixels(myStartImage, myCurrentImage.rect, myStartImage.rect) member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect) sprite(4).rect = rect(800, 600, 810, 610) sprite(5).rect = rect(800, 600, 810, 610) sprite(6).rect = rect(800, 600, 810, 610) sprite(7).rect = rect(800, 600, 810, 610) put EMPTY into field "dimension status W" put EMPTY into field "dimension status H" updateStage() fnUpdatePreview() sprite(35).pState = 0 sendSprite(35, #setMember) member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image myTimerStart = 0 gSelectionEdited = VOID gMarqueeRect = rect(0, 0, 0, 0) gSelectRect = rect(0, 0, 0, 0) myStartImage = VOID myCurrentImage = VOID myCurrentPreview = VOID myCurrentSelection = VOID else gSelectionEdited = 1 gMarqueeRect = rect(sprite(5).left, sprite(4).top, sprite(6).right, sprite(7).bottom) gSelectRect = rect((sprite(5).left - sprite(1).left) / gVariable, (sprite(4).top - sprite(1).top) / gVariable, (sprite(6).right - sprite(1).left) / gVariable, (sprite(7).bottom - sprite(1).top) / gVariable) put gSelectRect.width into field "dimension status W" put gSelectRect.height into field "dimension status H" end if end